﻿@{
    Layout = null;
}
@model System.Data.DataTable
<!DOCTYPE html>
<html>
@Html.Partial("LoadPanelPartial")
<head>
<title></title>
    @if (false)
    {
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
     <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    @Html.DevExpress().GetStyleSheets(
                new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme }

)
    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)

    <script type="text/javascript">

        function OnBeginCallback(s, e) {
            e.customArgs["command"] = e.command;
            e.customArgs["pageIndex"] = s.pageIndex;
            e.customArgs["pageCount"] = s.pageCount;
            e.customArgs["pageRowSize"] = s.pageRowSize;
            e.customArgs["pageRowCount"] = s.pageRowCount;

            e.customArgs["NSRMC"] = $('#hidNSRMC').val();
            e.customArgs["NSRBM"] = $('#hidNSRBM').val();
            e.customArgs["FFinancePropNo"] = $('#hidFFinancePropNo').val();
            e.customArgs["IsNoFull"] = $('#hidIsNoFull').val();
        }

        //重置
        function undo() {
            ASPxClientTextBox.Cast("NSRMC").SetText("");
            ASPxClientTextBox.Cast("NSRBM").SetText("");
            ASPxClientTextBox.Cast("FFinancePropNo").SetValue("");
            ASPxClientComboBox.Cast("IsNoFull").SetValue("");
        }

        function AllowanceApplicationFormFrontEdit(codeNo) {
            window.location.href = rootPath + '/AllowanceApplicationFormFront/AllowanceApplicationFormFrontEdit?FApplicationFormID=' + codeNo;
        }

        function AllowanceApplicationFormFrontDel(codeNo) {
            if (confirm("确定删除？")) {
                $.ajax({
                    type: 'POST',
                    url: rootPath + '/AllowanceApplicationFormFront/DelAllowanceApplicationFormFront',
                    data: { FApplicationFormID: codeNo },
                    success: function (result) {
                        if (result == "ok") {
                            alert("删除成功");
                            gvEditing.Refresh();
                        } else if (result == "error") {
                            alert("删除失败");
                        } else {
                            alert("参数错误");
                        }
                    }
                });
            }
        }

        function AllowanceApplicationFormFront(NSRDZDAH, FFileNo) {
            window.location.href = rootPath + '/AllowanceApplicationFormFront/AllowanceApplicationFormFrontEdit?NSRDZDAH=' + NSRDZDAH + "&FFileNo=" + FFileNo; 
        }

        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnAdd":
                    {
                        //增加
                        window.location.href = rootPath + '/AllowanceApplicationFormFront/AllowanceApplicationFormFrontEdit';
                        break;
                    }
                case "btnPrint":
                    {
                        //增加
                        var a = ASPxClientGridView.Cast("gvEditing").GetRowKey(ASPxClientGridView.Cast("gvEditing").GetFocusedRowIndex());
                        if (a != null && a != "-1") {
                            window.location.href = rootPath + '/AllowanceApplicationFormFront/AllowanceApplicationFormFrontPrint?FApplicationFormID=' + a + '&isshowje=false';
                        }
                        else {
                            alert("该企业未受理无法重打！");
                        }
                        break;
                    }
            }
        }


        //查询
        function search() {
            $('#hidNSRMC').val(NSRMC.GetText());
            $('#hidNSRBM').val(NSRBM.GetText());
            $('#hidFFinancePropNo').val(FFinancePropNo.GetValue());
            $('#hidIsNoFull').val(FStatus.GetValue());
            gvEditing.Refresh();
       
        }

    </script>
</head>
<body>

         @Html.DevExpress().Menu(settings =>
   {
       settings.Name = "toolBarMenu";
       settings.ItemAutoWidth = false;
       settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
       settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
       settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
       settings.Items.Add(item =>
       {
           item.Name = "btnAdd";
           item.Text = "预受理";
           item.Image.Url = Url.Content("~/Content/ControlImages/CG.png");
       });
       settings.Items.Add(item =>
       {
           item.Name = "btnPrint";
           item.Text = "重新打印";
           item.Image.Url = Url.Content("~/Content/ControlImages/print.png");
       });
           settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
       settings.ItemLinkMode = ItemLinkMode.ContentBounds;
   }).GetHtml()

   <table width="100%" class="tableForm">
        <tr>
           <td font-size="14pt" class="tdClass" align="right">@Html.DevExpress().Label(settings => { settings.Text = "纳税编码:"; }).GetHtml()</td>
           <td class="tdClass">
                 @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "NSRBM";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(120);
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
              
           </td>
           <td font-size="14pt" class="tdClass" align="right">@Html.DevExpress().Label(settings => { settings.Text = "纳税人名称:"; }).GetHtml()</td>
           <td class="tdClass">
                     @Html.DevExpress().TextBox(settings =>
               {
                   settings.Name = "NSRMC";
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(120);
                   settings.Properties.ValidationSettings.EnableCustomValidation = true;
               }).GetHtml()
              
           </td>
           
           <td class="tdClass">
           @Html.DevExpress().Button(settings =>
            {
                settings.Name = "btnSearch";
                settings.Text = "查询";
                settings.ControlStyle.CssClass = "button";
                settings.Images.Image.Url = Url.Content("~/Content/ControlImages/search.png");
                settings.ClientSideEvents.Click = "search";
            }).GetHtml()

             @Html.DevExpress().Button(settings =>
            {
                settings.Name = "btnUndo";
                settings.Text = "重置";
                settings.ControlStyle.CssClass = "button";
                settings.Images.Image.Url = Url.Content("~/Content/ControlImages/undo_blue.png");
                settings.ClientSideEvents.Click = "undo";
            }).GetHtml()

           </td>         
        </tr>
        <tr>
            <td font-size="14pt" class="tdClass" align="right">状态</td>
           <td class="tdClass">
          @Html.DevExpress().ComboBox(settings =>
      {
          settings.Name = "FStatus";
          settings.Width = 100;
          settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
          settings.Properties.TextField = "Text";
          settings.Properties.ValueField = "Value";
      }).BindList(new List<SelectListItem> { 
                           new SelectListItem { Text = "未受理", Value = "1" },
                           new SelectListItem { Text = "已受理", Value = "2" }
                      
     }).GetHtml()
           </td>    
            <td font-size="14pt" class="tdClass" align="right">@Html.DevExpress().Label(settings => { settings.Text = "资金性质:"; }).GetHtml()</td>
           <td class="tdClass">
           @Html.DevExpress().ComboBox(settings =>
               {
                   settings.Name = "FFinancePropNo";
                   settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                   settings.Width = System.Web.UI.WebControls.Unit.Pixel(120);
                   settings.Properties.TextField = "FFinancePropShortName";
                   settings.Properties.ValueField = "FFinancePropNo";
               }).BindList(ViewData["FinancePropList"]).Bind(ViewData["FFinancePropNo"]).GetHtml()
              
           </td>            
           <td class="tdClass">

           </td> 
                
        </tr>
     </table>
 
        @Html.Hidden("hidNSRMC", ViewData["NSRMC"])
        @Html.Hidden("hidNSRBM", ViewData["NSRBM"])
        @Html.Hidden("hidFFinancePropNo", ViewData["FFinancePropNo"])
        @Html.Hidden("hidIsNoFull", ViewData["IsNoFull"])
        @Html.Partial("AllowanceApplicationFormFrontListPartial", Model)
    <script>
        lp.Hide();
    </script>
</body>
</html>
